<template>
    <div>
        <loading v-if="!isReady"></loading>
        <div class="hoting">
            <movierow :comminglist="commingList" :showrow="0"></movierow>
            <movie-list v-for="(hotitem,i) in movieList " :key="i"  :mitem="hotitem"> </movie-list>
        </div>
    </div>
    
</template>

<script>
import axios from 'axios';
import MovieList from "./movieList";
import Movierow from './movierow.vue';
import Loading from '../../components/layout/loading.vue'

export default {
    name:'hoting',
    data(){
        return{
            movieList:[],
            commingList:[],
            isReady:false,
        };
    },
    created(){
        axios.post('/api/movie/selectMovieinfo').then(res => {
             res.data.forEach(element => {
                if (element.globalReleased) {
                    this.commingList.push(element);
                    this.isReady=true;
                }
            });
            this.movieList = res.data;
        })
    },
    components:{
        MovieList,
        Movierow,
        Loading
    }
}


</script>

<style scoped>

</style>